package com.platform.car.dao;

import com.platform.car.model.Cars;
import com.platform.common.annotation.MyBatisDao;
import com.platform.common.base.dao.BaseDao;

import java.util.List;

@MyBatisDao
public interface CarsDao extends BaseDao<Cars> {

    /**
     * 统计用户绑定几辆车
     * @param cars
     * @return
     */
    Long  countNumber(Cars cars);

    /**
     * 用户绑定的车牌是否已经绑定过了
     * @param cars
     * @return
     */
    Long  countNumberPlates(Cars cars);

    /**
     * 查询用户绑定车辆
     * @param cars
     * @return
     */
    List<Cars> selectByUserId(Cars cars);

    /**
     * 根据用户的Id和车牌号查询用户
     * @param cars
     * @return
     */
    Cars  selectByPlates(Cars cars);

    /**
     * 根据用户的Id删除
     * @param userId
     */
    Integer deleteByUserId(Integer userId);
}
